Skip to content

[ADD] rental_deposit: adding deposit to rental products.#1274

Draft
adpaw-odoo wants to merge 1 commit into
odoo:19.0from
odoo-dev:19.0-rental-deposit-adpaw
Draft

[ADD] rental_deposit: adding deposit to rental products.#1274
adpaw-odoo wants to merge 1 commit into
odoo:19.0from
odoo-dev:19.0-rental-deposit-adpaw

Conversation

@adpaw-odoo

@adpaw-odoo adpaw-odoo commented May 18, 2026

Copy link
Copy Markdown

Task ID- 4485648
Introduced a new custom module that adds deposit configuration on rental products and automatically manages deposit lines on sale orders and the web-shop. This allows businesses to enforce a refundable deposit whenever a rental product is added, both from the back-end and the front-end.

WHY this change is being made:
Currently, when a customer rents a product there is no built-in way to collect or track a deposit amount tied to that rental. Salespersons had to manually add deposit lines every time, which is error-prone and inconsistent. This module automates that process and ensures deposit lines are always present, correctly priced, and protected from accidental edits or deletions.

Technical decisions taken:

  1. Added require_deposit (Boolean) and 'deposit_amount' on 'product.template' to allow per-product deposit configuration under the Rental Prices tab.
  2. Extended 'res.company' with 'deposit_product_id' and exposed it via 'res.config.settings' using 'related=' to set a global deposit product that gets added as the order line product.
  3. Overrode create on sale.order.line with @api.model_create_multi to auto-add a deposit line whenever a qualifying rental product is added.
  4. Implemented write and @api.ondelete overrides to keep deposit line quantity in sync and remove it when the rental line is deleted.
  5. Used context keys skip_deposit_write_check and skip_deposit_delete_check to allow internal updates while blocking direct user edits on deposit lines.
  6. Inherited the webshop product template to display the deposit amount and added a JS widget (RentalDepositWidget) to update the displayed amount dynamically when the quantity selector is changed by the customer.

@robodoo

robodoo commented May 18, 2026

Copy link
Copy Markdown

Pull request status dashboard

@adpaw-odoo adpaw-odoo force-pushed the 19.0-rental-deposit-adpaw branch 2 times, most recently from ee14089 to 9861912 Compare May 19, 2026 05:21
@mash-odoo

mash-odoo commented May 25, 2026

Copy link
Copy Markdown

Hello!
I started doing the initial review but I am getting this error, can you please resolve it first?
Also, please add the task id in the PR description at the end

@adpaw-odoo adpaw-odoo force-pushed the 19.0-rental-deposit-adpaw branch 2 times, most recently from b3753a6 to 09860e4 Compare May 27, 2026 05:24
@adpaw-odoo adpaw-odoo force-pushed the 19.0-rental-deposit-adpaw branch from 09860e4 to 8123c78 Compare June 16, 2026 07:04
- Added  and  fields on  to
allow per-product deposit configuration
- Added  on , exposed via config settings
- Auto-add/update/delete deposit line on sale order via CRUD overrides
- Blocked direct editing or deletion of deposit lines using context guards
- Added deposit display on webshop product page with dynamic qty update
@adpaw-odoo adpaw-odoo force-pushed the 19.0-rental-deposit-adpaw branch from 8123c78 to dfb6609 Compare June 16, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants